﻿using System;
using System.Globalization;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;

namespace ConfApp.Infrastracture.HttpClient
{
    public static class HttpClient
    {
        public static HttpWebRequest RequestTo(Uri surveysUri, string userName, string password)
        {
            var request = (HttpWebRequest)WebRequest.Create(surveysUri);
            var authHeader = string.Format(CultureInfo.InvariantCulture, "user {0}:{1}", userName, password);
            request.Headers[HttpRequestHeader.Authorization] = authHeader;
            return request;
        }

        public static HttpWebRequest RequestTo(Uri uri)
        {
            return (HttpWebRequest)WebRequest.Create(uri);
        }
    }
}
